const express = require('express');
const router = express.Router();

router.post('/forDealerServiceInformation', (req, res) => {
    const data = [];
    for(let i = 0; i < 20; i++)
        data.push({
            id: `${i}`,
            brandId: '001',
            brandCode: `brandCode${i}`,
            brandName: `brandName${i}`,
            partId: `partId${i}`,
            partCode: `partCode${i}`,
            partName: `partName${i}`,
            priceRate: 0.20,
            startTime: '2019-12-05T07:11:55.731Z',
            endTime: '2019-12-05T07:11:55.731Z'
        });
    const {pageIndex, pageSize} = req.query;
    res.json({
        message: 'ok',
        payload: {
            content: data,
            pageIndex: parseInt(pageIndex, 10),
            pageSize: parseInt(pageSize, 10),
            totalElements: 20
        }
    });
});

module.exports = router;
